Common Notation

Introduction

Number theory uses a small but powerful collection of symbols.
This article introduces the notation you’ll see throughout the book, with simple explanations and examples.

Goals of this chapter:

The Natural Numbers and Integers

Natural numbers

Integers

Examples

Sets and Set‑Builder Notation

Basic set notation

Common sets

Set‑builder notation

Used to describe sets by a rule:

Intervals of integers

Divisibility Notation: $d \mid n$ and Related Symbols

Divisibility

Examples

Related ideas

Equality, Congruence, and Modular Notation

Equality

Congruence modulo $m$

Examples

Summation Notation: $\sum$

Purpose

Summation notation compactly represents adding many terms.

General form

$$\sum_{k=1}^{n} a_k$$

Examples

Notes

Product Notation: $\prod$

Purpose

Product notation represents multiplying many terms.

General form

$$\prod_{k=1}^{n} a_k$$

Examples

Intervals and Ranges of Integers

Common ways to describe ranges

Examples

Floor and Ceiling Functions

Floor function

Examples:

Ceiling function

Examples:

Absolute Value and Basic Function Notation

Absolute value

Examples:

Basic function notation

Logical Symbols in Number Theory

Common logical symbols

Examples

Common Abbreviations (gcd, lcm, etc.)

gcd

lcm

Other useful abbreviations

Calculator

Arrays

  • Arrays are like sets, except they can contain duplicates and be ordered in different ways
  • They use square brackets, with values separated by commas
[1, 2, 3] [3, 2, 1] [1, 1, 2, 3]

Ranges

  • Generate arrays with a start, stop, and optional increment
  • Uses the colon character as a separator
    • start:stop
    • start:increment:stop
1:10 1:0.1:10 10:-1:1 -1:-1:-10 1:2:10 2:2:10

Divides

  • Checks if one integer divides another without a remainder
divides(11, 1001) divides(11, 101)

Equiv

  • Checks if two numbers are congruent modulo $m$
equiv(a, b, modulus) equiv(12, 15, 3) equiv(13, 15, 3)

Sum

  • Computes the sum of a set of numbers
  • An optional function can be passed in that is applied to each number before summing
sum(1, 2, 3) sum([1, 2, 3]) sum(1:10) sum([1, 2, 3], f(x) = x * x)

Prod

  • Computes the product of a set of numbers
  • An optional function can be passed in that is applied to each number before multiplying
prod(1, 2, 3) prod([1, 2, 3]) prod(1:10, f(x) = 1)

Floor

  • Rounds a number (or array of numbers) down to the nearest integer
  • Optionally takes a second argument, specifying the number of decimal places that should appear in the returned number
    • e.g. $\operatorname{floor}(1.55) = 1$
    • but $\operatorname{floor}(1.55, 1) = 1.5$
floor(0.5) floor(-0.5) floor([1.5, 2.5]) floor(123.456, 2)

Ceil

  • Rounds a number (or array of numbers) up to the nearest integer
  • Optionally takes a second argument, specifying the number of decimal places that should appear in the returned number
    • e.g. $\operatorname{ceil}(1.55) = 2$
    • but $\operatorname{ceil}(1.55, 1) = 1.6$
ceil(0.5) ceil(-0.5) ceil([1.5, 2.5]) ceil(123.456, 2)

Abs

  • Caculates the absolute value of a number (or array of numbers)
abs(-0.5) abs(-5:5)

Functions

  • Creates a function
f(x) = x^2 f(2) f(3) g(a, b) = a + b g(f(2), f(3))

Map

  • Applies a function to array elements
map([1, 2, 3], f(x) = 2 * x) g(a) = 1 / a map(1:10, g)

Exercises

Try these to build comfort with the notation.

  1. Write the set of all odd natural numbers less than $15$ using set‑builder notation.

    Solution

    Odd natural numbers less than $15$ in set‑builder notation

    • The odd natural numbers less than $15$ are
      $1,3,5,7,9,11,13$.
    • In set‑builder notation: $$\{n \in \mathbb{N} : n \text{ is odd and } n < 15\}$$
  2. Determine whether each statement is true or false:
    • $4 \mid 20$
    • $6 \mid 25$
    • $3 \mid (n^2 - n)$ for all integers $n$

    Solution

    True/false divisibility statements

    • (a) $4 \mid 20$
      • $20 = 4 \cdot 5$, so this is true.
    • (b) $6 \mid 25$
      • There is no integer $k$ with $25 = 6k$, so this is false.
    • (c) $3 \mid (n^2 - n)$ for all integers $n$
      • Note $n^2 - n = n(n-1)$, the product of two consecutive integers.
      • Among any three consecutive integers, one is divisible by $3$, and $n$ and $n-1$ cover all residues mod $3$.
      • More concretely, check $n \equiv 0,1,2 \pmod{3}$:
        • If $n \equiv 0$, then $n^2 - n \equiv 0 - 0 \equiv 0 \pmod{3}$
        • If $n \equiv 1$, then $n^2 - n \equiv 1 - 1 \equiv 0 \pmod{3}$
        • If $n \equiv 2$, then $n^2 - n \equiv 4 - 2 \equiv 2 \equiv -1 \pmod{3}$ — wait, that looks off; check carefully:
          • $n \equiv 2 \Rightarrow n^2 \equiv 4 \equiv 1 \pmod{3}$, so $n^2 - n \equiv 1 - 2 \equiv -1 \equiv 2 \pmod{3}$
          • So this residue check suggests not always $0$; better to test directly:
            • Take $n=2$: $n^2 - n = 4 - 2 = 2$, and $3 \nmid 2$.
      • So the statement is actually false.
  3. Compute the following sums:
    • $\sum_{k=1}^{5} k$
    • $\sum_{k=1}^{4} (k+2)$

    Solution

    Summations

    • (a) $\displaystyle \sum_{k=1}^{5} k$ $$1 + 2 + 3 + 4 + 5 = 15$$
    • (b) $\displaystyle \sum_{k=1}^{4} (k+2)$
      Expand the terms: $$(1+2) + (2+2) + (3+2) + (4+2) = 3 + 4 + 5 + 6 = 18$$
  4. Compute the products:
    • $\prod_{k=1}^{4} k$
    • $\prod_{k=2}^{4} (k+1)$

    Solution

    Products

    • (a) $\displaystyle \prod_{k=1}^{4} k$ $$1 \cdot 2 \cdot 3 \cdot 4 = 24$$
    • (b) $\displaystyle \prod_{k=2}^{4} (k+1)$
      Terms are $(2+1)(3+1)(4+1)$: $$3 \cdot 4 \cdot 5 = 60$$
  5. Evaluate the congruences:
    • $17 \equiv ? \pmod{6}$
    • $50 \equiv ? \pmod{7}$

    Solution

    Congruences

    • (a) $17 \equiv ? \pmod{6}$
      • Divide $17$ by $6$: $17 = 6 \cdot 2 + 5$
      • So the remainder is $5$: $$17 \equiv 5 \pmod{6}$$
    • (b) $50 \equiv ? \pmod{7}$
      • Divide $50$ by $7$: $50 = 7 \cdot 7 + 1$
      • So the remainder is $1$: $$50 \equiv 1 \pmod{7}$$
  6. Evaluate:
    • $\lfloor 7.9 \rfloor$
    • $\lceil -2.3 \rceil$

    Solution

    Floor and ceiling

    • (a) $\lfloor 7.9 \rfloor$
      • Greatest integer $\le 7.9$ is $7$: $$\lfloor 7.9 \rfloor = 7$$
    • (b) $\lceil -2.3 \rceil$
      • Smallest integer $\ge -2.3$ is $-2$: $$\lceil -2.3 \rceil = -2$$
  7. Let $f(n) = 3n - 1$. Compute $f(4)$ and $f(10)$.

    Solution

    Function values

    Let $f(n) = 3n - 1$.

    • $f(4) = 3 \cdot 4 - 1 = 12 - 1 = 11$
    • $f(10) = 3 \cdot 10 - 1 = 30 - 1 = 29$
  8. Find $\gcd(18, 30)$ and $\operatorname{lcm}(6, 15)$.

    Solution

    $\gcd$ and $\operatorname{lcm}$

    • $\gcd(18,30)$
      • Prime factorizations:
        • $18 = 2 \cdot 3^2$
        • $30 = 2 \cdot 3 \cdot 5$
      • Common prime factors with smallest exponents: $2^1 \cdot 3^1 = 6$
      • So: $$\gcd(18,30) = 6$$
    • $\operatorname{lcm}(6,15)$
      • Prime factorizations:
        • $6 = 2 \cdot 3$
        • $15 = 3 \cdot 5$
      • Take all primes with largest exponents: $2^1 \cdot 3^1 \cdot 5^1 = 30$
      • So: $$\operatorname{lcm}(6,15) = 30$$